package com.example.alarm.bl;

import com.example.alarm.AlarmApplication;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class PreferencesManager {
	private SharedPreferences mPrefs;
	private static PreferencesManager mInstance;

	public static PreferencesManager getInstance() {
		if (mInstance == null) {
			mInstance = new PreferencesManager();
		}
		return mInstance;
	}

	private PreferencesManager() {
		mPrefs = PreferenceManager
				.getDefaultSharedPreferences(AlarmApplication.applicationcontext);
	}

	

	public void setAlarmHours(int hours) {
		SharedPreferences.Editor edit = mPrefs.edit();
		edit.putInt("alarmhours", hours);
		edit.commit();
	}
	
	
	public int getAlarmHours(){
		return mPrefs.getInt("alarmhours", 2);
	}
}
